<?php
App::uses('AppController', 'Controller');
class TestsController extends AppController {
	public $name = 'Tests';
	public $uses = array();

	public function index() {
		
	}
	public function index2() {
		
	}
	
	public function add() {
		$this->layout = 'ajax';
	}
	
	public function edit() {
		$this->layout = 'ajax';
	}
	
	public function save() {
		$success = false;
		if($success){
			$this->Session->write('status', 'success');
			$this->Session->setFlash("<strong>Well done!</strong> You successfully save data.");
		}else{
			$this->Session->write('status', 'error');
			$this->Session->setFlash("<strong>Oh snap!</strong> Change a few things up and try submitting again.");
		}
		$this->redirect($this->referer());
	}
	
	public function deleteConfirm() {
		$this->layout = 'ajax';
	}
	
	public function delete() {
		$success = true;
		if($success){
			$this->Session->write('status', 'success');
			$this->Session->setFlash("<strong>Well done!</strong> You successfully delete data.");
		}else{
			$this->Session->write('status', 'error');
			$this->Session->setFlash("<strong>Oh snap!</strong> Can't delete data, please try again.");
		}
		$this->redirect($this->referer());
	}
	
	function view(){
		
	}
	
	function view2(){
		
	}
	
	function setting(){
		
	}
	
	function setting2(){
		
	}
}
